package com.gyyx.cn.transaction.test.service;

import com.gyyx.cn.transaction.test.dao.AccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: 王海新
 * @date: 2021/12/9/0009 15:43
 * @version: 1.0
 * @description: TODO
 */
@Service
public class Account2Service {
    @Autowired
    private AccountDao accountDao;
    @Transactional
    public void transfer (String fromCardNo,String toCardNo,Integer money){
        accountDao.fromCard(money,fromCardNo);
        accountDao.toCard(money,toCardNo);
    }
}